
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>使用 · dynamic-router</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Gj">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="index.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="dynamic.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter active" data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="dynamic.html">
            
                <a href="dynamic.html">
            
                    
                    动态路由
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >使用</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x52A8;&#x6001;&#x8DEF;&#x7531;">&#x52A8;&#x6001;&#x8DEF;&#x7531;</h1>
<blockquote>
<p>&#x5F53;&#x524D;&#x5F00;&#x53D1;&amp;&#x90E8;&#x7F72;&#x73AF;&#x5883;&#x4E3A; Linux&#x53D1;&#x884C;&#x7248;  <strong>Manjaro</strong></p>
<p>&#x547D;&#x4EE4;&#x64CD;&#x4F5C;&#x4EE5;Linux&#x4E3A;&#x51C6;</p>
</blockquote>
<h4 id="&#x524D;&#x7AEF;">&#x524D;&#x7AEF;</h4>
<blockquote>
<p>vue-element-admin</p>
<p>&#x76EE;&#x5F55; <strong>dynamic-router/page</strong></p>
</blockquote>
<h5 id="&#x542F;&#x52A8;">&#x542F;&#x52A8;</h5>
<pre class="language-"><code class="lang-shell">npm install &amp;&amp; npm run dev
#&#x6216;&#x8005;
yarn &amp;&amp; yarn dev
</code></pre>
<h5 id="&#x7F16;&#x8BD1;&#x6253;&#x5305;">&#x7F16;&#x8BD1;&#x6253;&#x5305;</h5>
<pre class="language-"><code class="lang-shell">npm run build
#&#x6216;&#x8005;
yarn build
</code></pre>
<h4 id="&#x540E;&#x7AEF;">&#x540E;&#x7AEF;</h4>
<blockquote>
<p>Go 1.3+&#x3001;Gin&#x3001;Mysql5.6</p>
<p>&#x76EE;&#x5F55; dynamic-router/service</p>
</blockquote>
<h5 id="&#x542F;&#x52A8;">&#x542F;&#x52A8;</h5>
<pre class="language-"><code class="lang-shell">ROUTER_MODE=release \
ROUTER_PORT=8082 \
ROUTER_DB_USER=root \
ROUTER_DB_PWD=123456 \
ROUTER_HOST=192.168.1.129:3306 \
ROUTER_DB_NAME=dynamic_router \
./script/generateConfig.sh &amp;&amp; \
go run *.go
</code></pre>
<h5 id="&#x7F16;&#x8BD1;">&#x7F16;&#x8BD1;</h5>
<blockquote>
<p>window 64</p>
</blockquote>
<pre class="language-"><code class="lang-shell">CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build .
</code></pre>
<blockquote>
<p>Linux alias -&gt; app</p>
</blockquote>
<pre class="language-"><code class="lang-shell">go build -o app
</code></pre>
<h4 id="&#x5BB9;&#x5668;&#x5316;">&#x5BB9;&#x5668;&#x5316;</h4>
<blockquote>
<p>&#x9ED8;&#x8BA4;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x53EF;&#x6267;&#x884C;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;</p>
<p>&#x5728;&#x76EE;&#x5F55; <strong>dynamic-router/page</strong>&#x4E0B;</p>
<p>&#x9700;&#x8981;&#x63D0;&#x524D;&#x5B89;&#x88C5; <strong>docker</strong>&#x548C; <strong>docker-compose</strong></p>
</blockquote>
<h5 id="&#x90E8;&#x7F72;shell">&#x90E8;&#x7F72;shell</h5>
<pre class="language-"><code class="lang-shell">cd page \
./deploy.sh # start | restart =&gt; default: start
</code></pre>
<h5 id="mysql">Mysql</h5>
<blockquote>
<p>&#x9ED8;&#x8BA4;&#x8BBF;&#x95EE;&#x672C;&#x5730;<strong>129</strong>&#x670D;&#x52A1;&#x5668;&#x3002;</p>
<p>&#x5982;&#x679C;&#x9700;&#x8981;&#x66FF;&#x6362;&#xFF0C;&#x9700;&#x8981;&#x4FEE;&#x6539; <strong>conf/app.ini</strong></p>
<p>&#x811A;&#x672C;&#x6587;&#x4EF6; <strong>dynamic-router/service/dynamic_router.sql</strong></p>
</blockquote>
<h5 id="&#x8BBF;&#x95EE;">&#x8BBF;&#x95EE;</h5>
<blockquote>
<p>&#x7AEF;&#x53E3;&#x53F7;&#x4E3A; 12333</p>
<p><a href="http://ip:12333" target="_blank">http://ip:12333</a></p>
</blockquote>
<h4 id="windows&#x73AF;&#x5883;">windows&#x73AF;&#x5883;</h4>
<blockquote>
<p>&#x5728; <strong>dynamic/service</strong>&#x76EE;&#x5F55;&#x4E0B;&#x6211;&#x9ED8;&#x8BA4;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A; .exe&#x7684;window&#x73AF;&#x5883;&#x4E0B;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x590D;&#x5236; <strong>conf</strong>&#x548C; <strong>service.exe</strong>&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x653E;&#x5230;&#x540C;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#x4E0B;&#xFF0C;&#x76F4;&#x63A5;&#x542F;&#x52A8;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;&#x3002;</p>
<p>&#x8FD9;&#x6837;&#x524D;&#x7AEF;&#x8FD0;&#x884C;&#x8D77;&#x6765;&#xFF0C;&#x9ED8;&#x8BA4;&#x8BBF;&#x95EE;&#x670D;&#x52A1;&#x7AEF; <strong>8082</strong>&#x7AEF;&#x53E3;&#xFF0C;&#x9879;&#x76EE;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x3002;</p>
</blockquote>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="dynamic.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 动态路由">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"使用","level":"1.1","depth":1,"next":{"title":"动态路由","level":"1.2","depth":1,"path":"dynamic.md","ref":"dynamic.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","-lunr","-search","search-pro","-highlight","prism"],"styles":{"website":"index.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"expandable-chapters":{},"search-pro":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Gj","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"dynamic-router","language":"zh-hans","gitbook":"3.2.3","description":"动态路由"},"file":{"path":"README.md","mtime":"2020-07-31T06:15:43.556Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-07-31T07:40:46.045Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

